from importlib import import_module

father = import_module('class1')

def choose(var):
    global father
    print('选择：')
    if var == '1':
        father = import_module('class1')
    elif var == '2':
        father = import_module('class2')
    else:
        print('输入错误！')
    
    # obj = MyClass()

def create_class():
    class MyClass(father.cls):
        def __init__(self):
            super().__init__()
            print('子类初始化')
            pass
    return MyClass

# obj = MyClass()
def create_obj():
    obj = create_class()()
    return obj


if __name__ == '__main__':
    choose('2')
    MyClass = create_class()
    obj = MyClass()
